home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2005 October / PCWOCT05.iso / Software / FromTheMag / The GIMP 2.2.8 / gimp-2.2.8-i586-setup.exe / {app} / share / gimp / 2.0 / scripts / script-fu-util.scm < prev    next >
Encoding:
Text File  |  2005-06-30  |  1.2 KB  |  30 lines

  1. ; The GIMP -- an image manipulation program
  2. ; Copyright (C) 1995 Spencer Kimball and Peter Mattis
  3. ;
  4. ; This program is free software; you can redistribute it and/or modify
  5. ; it under the terms of the GNU General Public License as published by
  6. ; the Free Software Foundation; either version 2 of the License, or
  7. ; (at your option) any later version.
  8. ;
  9. ; This program is distributed in the hope that it will be useful,
  10. ; but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. ; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  12. ; GNU General Public License for more details.
  13. ;
  14. ; You should have received a copy of the GNU General Public License
  15. ; along with this program; if not, write to the Free Software
  16. ; Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  17.  
  18. ; Resizes the image so as to include the selected layer.
  19. ; The resulting image has the selected layer size.
  20. ; Copyright (C) 2002 Chauk-Mean PROUM
  21. ;
  22. (define (script-fu-util-image-resize-from-layer image
  23.                         layer)
  24.   (let*
  25.       ((width (car (gimp-drawable-width layer)))
  26.        (height (car (gimp-drawable-height layer)))
  27.        (posx (- (car (gimp-drawable-offsets layer))))
  28.        (posy (- (cadr (gimp-drawable-offsets layer)))))
  29.     (gimp-image-resize image width height posx posy)))
  30.